package com.example.othree.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

/**
 * @Author zhangmiaohang
 * @Date 2024/09/14
 */

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@TableName("drone_observation_data")
public class Drone {
    @TableId(value = "id", type = IdType.AUTO)
    Integer id;

    @TableField(value = "equipment_name")
    String equipmentName;

    @TableField(value = "equipment_number")
    String equipmentNumber;


//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "Asia/Shanghai")
    @TableField(value = "detection_time")
    Date detectionTime;

    Double lon;
    Double lat;
    Double elevation;
    Double temp;
//    @JsonProperty("pm1_0")
//    @TableField(value = "pm1_0")
    int pm1_0;
//    @TableField(value = "pm2_5")
//    @JsonProperty("pm2_5")
    int pm2_5;
    int pm10;
    Double humidity;
    Double O3;
    int countId;


    // Setter 方法
    public void setPm1Point0(int pm1_0) {
        this.pm1_0 = pm1_0;
    }
    public void setPm2Point5(int pm2_5) {
        this.pm2_5 = pm2_5;
    }

}
